<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="sec" uri="/WEB-INF/tags/shiro.tld"%>
<%@ page import="avicit.platform6.commons.utils.ComUtil"%>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>添加</title>

<base href="<%=ComUtil.getRequestPath(request)%>">
<%
	Locale locale =SessionHelper.getLocaleByUser(request);
%>
<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<link href="avicit/cape/oms/css/icon.css" type="text/css"
	rel="stylesheet">
	<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
</head>
<body class="easyui-layout" fit="true">
	<div region="center" border="false" style="overflow: hidden;">
		<form id="formCbbFondsDb" method="post">
			<table class="form_commonTable"  style="margin: 10px 0px 0px -12px !important;">
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_odCode">
						<%-- 全宗号 --%>
						<th width="20%"><span class=""></span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.allArchiveNum","i18n.lantop",locale)%>：</th>
						<td width="30%"><input type="text" validType="length[0,100]"
							style="" class="easyui-validatebox"
							data-options="required:true" title="全宗号" id="odCode"
							name="orgCode" value="${OD_CODE }" readonly="readonly" /></td>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_odName">
						<%-- 全宗名称 --%>
						<th width="20%"><span class=""></span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.allArchiveName","i18n.lantop",locale)%>：</th>
						<td><input type="text" validType="length[0,100]"
							style="" class="easyui-validatebox"
							data-options="required:true" title="全宗名称" id="odName"
							name="orgName" value="${OD_NAME }" readonly="readonly" /></td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_dbName">
						<%-- 数据库名称 --%>
						<th width="20%"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.databaseName","i18n.lantop",locale)%>：</th>
						<td width="30%"><input type="text" validType="length[0,50]"
							style="" class="easyui-validatebox"
							data-options="required:true" title="数据库名称" id="dbName"
							name="dbName" /></td>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_dbPort">
						<%-- 端口 --%>
						<th width="20%"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.port","i18n.lantop",locale)%>：</th>
						<td><input type="text" validType="length[0,50]"
							style="" class="easyui-numberbox" data-options="required:true" title="端口"
							id="dbPort" name="dbPort" /></td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_dbIp">
						<%-- 数据库服务器IP --%>
						<th width="20%"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.databaseServerIP","i18n.lantop",locale)%>：</th>
						<td width="30%"><input type="text"
							data-options="validType:'length[0,200]',required:true"
							style="" class="easyui-validatebox" title="数据库服务器IP"
							id="dbIp" name="dbIp" /></td>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_dbUser">
						<%-- 数据库用户名 --%>
						<th width="20%"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.databaseUserName","i18n.lantop",locale)%>：</th>
						<td><input type="text" validType="length[0,50]"
							style="" class="easyui-validatebox" data-options="required:true" title="数据库用户名"
							id="dbUser" name="dbUser" /></td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_dbPassword">
						<%-- 数据库密码 --%>
						<th width="20%"><span class="remind">*</span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.databasePassword","i18n.lantop",locale)%>：</th>
						<td width="30%"><input type="password" validType="length[0,50]"
							style="" class="easyui-validatebox" data-options="required:true" title="数据库密码"
							id="dbPassword" name="dbPassword" /></td>
					</sec:accesscontrollist>
					<th width="10%"></th>
					<td></td>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_CbbFondsDbAdd_formCbbFondsDb_remark">
						<%-- 备注 --%>
						<th width="20%"><span class=""></span><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.comment","i18n.lantop",locale)%>：</th>
						<td colspan="3"><textarea type="text" class="textareabox" title='备注' name="remark"
								id="remark" validType="length[0,4000]"></textarea>
						</td>
					</sec:accesscontrollist>
				</tr>
			</table>
			<div style="display: none;">
				<label>id</label>
				<div class="inputContainer">
					<input name="id" id="id" required="true" value="${id }"
						style="" />
				</div>
			</div>
			<div style="display: none;">
				<label>orgId</label>
				<div class="inputContainer">
					<input name="orgId" id="orgId" required="true"
						value="${ORG_ID}" style="" />
				</div>
			</div>
		</form>
	</div>

	<div data-options="region:'south',border:false" style="height:40px;">
		<!-- <div id="toolbar" class="datagrid-toolbar datagrid-toolbar-extend foot-formopera"> -->
			<table class="tableForm" border="0" cellspacing="1" width="100%">
				<tr>
					<td align="center">
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_CbbFondsDbAdd_button_saveButton">
							<%-- 保存 --%> 
							<a id="saveButton" class="easyui-linkbutton selbtnc" onclick="saveForm();"  iconCls="icon-im-save"
								href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.button.save","i18n.lantop",locale)%></a>
						</sec:accesscontrollist>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_CbbFondsDbAdd_button_resetForm">
							<%-- 重置 --%>
							<a id="resetButton" class="easyui-linkbutton selbtnc"   iconCls="icon-im-newreduction"
								onclick="resetForm();" href="javascript:void(0);">
								<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.button.reset","i18n.lantop",locale)%></a>
						</sec:accesscontrollist>
						<sec:accesscontrollist hasPermission="3"
							domainObject="formdialog_CbbFondsDbAdd_button_backForm">
							<%-- 返回 --%>
							<a id="backButton" class="easyui-linkbutton  selbtnc"   iconCls="icon-im-back"
								onclick="closeWindow();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.fondsmanager.button.add.button.return","i18n.lantop",locale)%></a>
						</sec:accesscontrollist>
					</td>
				</tr>
			</table>
		<!-- </div> -->
	</div>
	<script type="text/javascript">
		var dialogId = "${dialogId}";
	
		/**
		 * IP地址格式验证
		 */
		$.extend($.fn.validatebox.defaults.rules, {
		    validateIp: {
		        validator: function(value, param) {
		            var pattern = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
		            return pattern.test(value);
		        },
		        message: 'IP地址格式不正确'
		    }
		});
	
		//保存
		function saveForm() {
	
		    var validateFlag = $('#formCbbFondsDb').form('validate');
		    if (validateFlag == false) {
		        return;
		    }
		    var dataVo = $('#formCbbFondsDb').serializeArray();
		    var dataJson = convertToJson(dataVo);
		    dataVo = JSON.stringify(dataJson);
		    $.ajax({
		        url: 'platform/cbbFondsDbController/saveCbbFondsDb',
		        data: {
		            datas: dataVo,
		            type: 'save',
		            sysId: '${sysId}'
		        },
		        type: 'post',
		        dataType: 'json',
		        success: function(result) {
		            parent.freDataGrid();
		            closeWindow();
		        }
		    });
		}
	
		/**
		 * 关闭弹出窗口
		 */
		function closeWindow() {
		    if (parent != null && parent.$('#' + dialogId) != null) {
		        parent.$('#' + dialogId).dialog('close');
		    }
		}
	
		/**
		 * 重置表单数据
		 */
		function resetForm(formName, type) {
		    $('#formCbbFondsDb').form('reset');
		}
	</script>
</body>
</html>